package com.cml.domain.builder;

import com.cml.common.config.Configuration;
import com.cml.domain.entity.ServerNode;

/**
 * 姓名：陈茂林
 * 时间：2023/11/8 8:26
 * 描述：
 */
public class ServerNodeBuilder {
    Configuration configuration = Configuration.getInstance();

    public ServerNodeBuilder(){
    }
    public ServerNode build(){
        ServerNode serverNode = new ServerNode();
        serverNode.setId(configuration.getNodeServerId());
        serverNode.setIp(configuration.getNodeIp());
        serverNode.setPort(configuration.getNodeServerPort());
        serverNode.setFollower(configuration.isFollower());
        serverNode.setRole(configuration.getNodeRole());
        serverNode.setServiceManagerPort(this.configuration.getServiceManagerPort());
        return serverNode;
    }

}
